import Vue from 'vue';
import Vuex from 'vuex';
import * as actions from './actions';
import * as mutations from './mutations';
import * as getters from './getters';
import storage from '@/plugins/storage.js'

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    navList: [], // 首页快捷导航
    cartNum: storage.getItem('cartNum') || 0,
    logoImg: storage.getItem('logoImg') || require('@/assets/images/logo.jpg'),
    // logoImg: storage.getItem('logoImg') || require('https://scm.gllscm.com/xp/static/img/sitelogo.90d3fbb7.png'),
    siteName:'万物通选品'|| 'lilishop',
    hotWordsList: storage.getItem('hotWordsList'),
    category: localStorage.getItem('category') ? JSON.parse(localStorage.getItem('category')) : [],
    goodslabel: localStorage.getItem('goodslabel') ? JSON.parse(localStorage.getItem('goodslabel')) : [],
    categoryId: ''
  },
  getters,
  actions,
  mutations
});
